﻿using System.ComponentModel.DataAnnotations;

namespace RuoVea.CodeGen.Server.Models;

/// <summary>
/// 元数据字段扩展表
/// </summary>
[SugarTable(nameof(GenFieldMetadataExAvue), "元数据字段扩展表")]
public class GenFieldMetadataExAvue : EntityBaseId
{ 
    /// <summary>
    /// 表Id
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public long TableMetaId { get; set; }
    /// <summary>
    /// 
    /// </summary>
    public long FieldMetadataId { get; set; }
 
    /// <summary>
    /// 对应列的宽度
    /// </summary>
    [Display(Name = "对应列的宽度")]
    public string? Width { get; set; }

    /// <summary>
    /// 对应列的最小宽度，与 width 的区别是 width 是固定的，minWidth 会把剩余宽度按比例分配给设置了 minWidth 的列
    /// </summary>
    [Display(Name = "对应列的最小宽度")]
    public string? MinWidth { get; set; }

    /// <summary>
    /// 列是否固定在左侧或者右侧，true 表示固定在左侧
    /// </summary>
    [Display(Name = "列是否固定在左侧或者右侧")]
    public bool? Fixed { get; set; }

    /// <summary>
    /// 对应列是否可以排序，如果设置为 'custom'，则代表用户希望远程排序，需要监听 Table 的 sort-change 事件
    /// </summary>
    [Display(Name = "对应列是否可以排序")]
    public string? Sortable { get; set; }

    /// <summary>
    /// 用来格式化列内容
    /// </summary>
    [Display(Name = "用来格式化列内容")]
    public string? Formatter { get; set; }

    /// <summary>
    /// 当内容过长被隐藏时显示 tooltip
    /// </summary>
    [Display(Name = "当内容过长被隐藏时显示 tooltip")]
    public bool? OverHidden { get; set; }

    /// <summary>
    /// 对齐方式
    /// </summary>
    [Display(Name = "对齐方式")]
    public string? Align { get; set; }

    /// <summary>
    /// 表头对齐方式，若不设置该项，则使用表格的对齐方式
    /// </summary>
    [Display(Name = "表头对齐方式")]
    public string? HeaderAlign { get; set; }

    /// <summary>
    /// 数据过滤的选项
    /// </summary>
    [Display(Name = "数据过滤的选项")]
    public bool? Filters { get; set; }

    /// <summary>
    /// 是否为搜索项
    /// </summary>
    [Display(Name = "是否为搜索项")]
    public bool? Search { get; set; }

    /// <summary>
    /// 搜索项初始化值
    /// </summary>
    [Display(Name = "搜索项初始化值")]
    public string? SearchValue { get; set; }

    /// <summary>
    /// 搜索项辅助文字
    /// </summary>
    [Display(Name = "搜索项辅助文字")]
    public string? SearchPlaceholder { get; set; }

    /// <summary>
    /// 搜索项框栅列
    /// </summary>
    [Display(Name = "搜索项框栅列")]
    public int? SearchSpan { get; set; }

    /// <summary>
    /// 搜索项位置排序，序号越大越靠前
    /// </summary>
    [Display(Name = "搜索项位置排序")]
    public int? SearchOrder { get; set; }

    /// <summary>
    /// 搜索项框间距
    /// </summary>
    [Display(Name = "搜索项框间距")]
    public int? SearchGutter { get; set; }

    /// <summary>
    /// 搜索项为范围搜索
    /// </summary>
    [Display(Name = "搜索项为范围搜索")]
    public bool? SearchRange { get; set; }

    /// <summary>
    /// 搜索项的类型
    /// </summary>
    [Display(Name = "搜索项的类型")]
    public string? SearchType { get; set; }

    /// <summary>
    /// 搜索项标题宽度
    /// </summary>
    [Display(Name = "搜索项标题宽度")]
    public int? SearchLabelWidth { get; set; }

    /// <summary>
    /// 搜索项清除
    /// </summary>
    [Display(Name = "搜索项清除")]
    public bool? SearchClearable { get; set; }

    /// <summary>
    /// 搜索项是否多选
    /// </summary>
    [Display(Name = "搜索项是否多选")]
    public bool? SearchMultiple { get; set; }

    /// <summary>
    /// 搜索项将选中值按文字的形式展示
    /// </summary>
    [Display(Name = "搜索项将选中值按文字的形式展示")]
    public bool? SearchTags { get; set; }

    /// <summary>
    /// 搜索项标题位置
    /// </summary>
    [Display(Name = "搜索项标题位置")]
    public string? SearchLabelPosition { get; set; }

    /// <summary>
    /// 弹出表单是否显示
    /// </summary>
    [Display(Name = "弹出表单是否显示")]
    public bool? Display { get; set; }

    /// <summary>
    /// 弹出表单是否禁止
    /// </summary>
    [Display(Name = "弹出表单是否禁止")]
    public bool? Disabled { get; set; }

    /// <summary>
    /// 表单新增时项是否禁止
    /// </summary>
    [Display(Name = "表单新增时项是否禁止")]
    public bool? AddDisabled { get; set; }

    /// <summary>
    /// 表单编辑时项是否禁止
    /// </summary>
    [Display(Name = "表单编辑时项是否禁止")]
    public bool? EditDisabled { get; set; }

    /// <summary>
    /// 表单查看时项是否禁止
    /// </summary>
    [Display(Name = "表单查看时项是否禁止")]
    public bool? ViewDisabled { get; set; }

    /// <summary>
    /// 表单新增时项是否显示
    /// </summary>
    [Display(Name = "表单新增时项是否显示")]
    public bool? AddDisplay { get; set; }

    /// <summary>
    /// 表单编辑时项是否显示
    /// </summary>
    [Display(Name = "表单编辑时项是否显示")]
    public bool? EditDisplay { get; set; }

    /// <summary>
    /// 表单查看时项是否显示
    /// </summary>
    [Display(Name = "表单查看时项是否显示")]
    public bool? ViewDisplay { get; set; }

    /// <summary>
    /// 对应列是否可以通过拖动改变宽度（需要在option中border属性为真）
    /// </summary>
    [Display(Name = "对应列是否可以通过拖动改变宽度")]
    public bool? Resizable { get; set; }

    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToOne, nameof(FieldMetadataId))]
    public GenFieldMetadataExAvue? ExAvue { get; set; }
}